package com.gaohe.official.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.official.mapper.FmAdvertMapper;
import com.gaohe.official.domain.FmAdvert;
import com.gaohe.official.service.IFmAdvertService;

/**
 * 系统广告Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmAdvertServiceImpl implements IFmAdvertService 
{
    @Autowired
    private FmAdvertMapper fmAdvertMapper;

    /**
     * 查询系统广告
     * 
     * @param advertId 系统广告主键
     * @return 系统广告
     */
    @Override
    public FmAdvert selectFmAdvertByAdvertId(Long advertId)
    {
        return fmAdvertMapper.selectFmAdvertByAdvertId(advertId);
    }

    /**
     * 查询系统广告列表
     * 
     * @param fmAdvert 系统广告
     * @return 系统广告
     */
    @Override
    public List<FmAdvert> selectFmAdvertList(FmAdvert fmAdvert)
    {
        return fmAdvertMapper.selectFmAdvertList(fmAdvert);
    }

    /**
     * 新增系统广告
     * 
     * @param fmAdvert 系统广告
     * @return 结果
     */
    @Override
    public int insertFmAdvert(FmAdvert fmAdvert)
    {
        fmAdvert.setCreateTime(DateUtils.getNowDate());
        return fmAdvertMapper.insertFmAdvert(fmAdvert);
    }

    /**
     * 修改系统广告
     * 
     * @param fmAdvert 系统广告
     * @return 结果
     */
    @Override
    public int updateFmAdvert(FmAdvert fmAdvert)
    {
        fmAdvert.setUpdateTime(DateUtils.getNowDate());
        return fmAdvertMapper.updateFmAdvert(fmAdvert);
    }

    /**
     * 批量删除系统广告
     * 
     * @param advertIds 需要删除的系统广告主键
     * @return 结果
     */
    @Override
    public int deleteFmAdvertByAdvertIds(Long[] advertIds)
    {
        return fmAdvertMapper.deleteFmAdvertByAdvertIds(advertIds);
    }

    /**
     * 删除系统广告信息
     * 
     * @param advertId 系统广告主键
     * @return 结果
     */
    @Override
    public int deleteFmAdvertByAdvertId(Long advertId)
    {
        return fmAdvertMapper.deleteFmAdvertByAdvertId(advertId);
    }
}
